Skip to content

Feat: Add build egress hatch and bump allow-list - #37

Merged
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:feat/build-egress-hatch-allowlist-v0.10.0
Jul 29, 2026
Merged

Feat: Add build egress hatch and bump allow-list#37
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:feat/build-egress-hatch-allowlist-v0.10.0

Conversation

@ModeSevenIndustrialSolutions

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Feat: Add build egress hatch and bump allow-list

Two related changes ensuring builds work reliably under harden-runner block mode.

1. build_permit_egress_traffic (implemented as a single harden-runner step)

New optional input (boolean, default false). When true, the python-build job runs harden-runner in audit mode while every other job stays governed by harden_runner_egress. Build lanes fetch dependencies from CDNs that are impractical to enumerate in the egress allow-list; this narrows the exemption to the one job that needs it, instead of dropping every job to audit via harden_runner_egress: 'audit'.

Each job now uses one harden-runner step with the policy computed inline — not two steps (block / audit) selected by a step-level if:. harden-runner declares a pre entry point and no pre-if, so its pre-phase (where the network policy engages) runs regardless of the condition. With two steps both pre-phases engage, block runs first and wins, and the if: only gates the inert main phase — so audit / build_permit_egress_traffic would be silently unreachable. This matches the fix in java-workflows (Fix: Apply one harden-runner step per job).

# non-build jobs
egress-policy: ${{ inputs.harden_runner_egress == 'audit' && 'audit' || 'block' }}

# python-build job (folds in the hatch)
egress-policy: ${{ (inputs.build_permit_egress_traffic || inputs.harden_runner_egress == 'audit') && 'audit' || 'block' }}

The allow-list loads unconditionally (a small fetch audit mode ignores). Default false preserves current behaviour, and the fail-secure default is retained — anything other than an explicit audit request resolves to block.

2. Allow-list bump → .github v0.12.1

The pin moves to @60d8d71016f31c26775e5ec9380eba4264aa6f9e # v0.12.1.

This repository was the furthest behind of the four workflow repos. v0.12.0 added 66 Linux Foundation platform hosts (documentation sites, wikis and Jira tenants; the Nexus/Nexus3 artifact repositories including Docker registry ports 10001–10004; JFrog Artifactory; ReadTheDocs; and Gerrit for Anuket/OPNFV on 443 + 29418), taking the list from 97 to 163. v0.12.1 then adds the Yarn egress endpoints (registry.yarnpkg.com, dl.yarnpkg.com) — Yarn's documented corporate-firewall set, needed so block-mode yarn install succeeds for Yarn-based consumers.

The bump covers every live pin in the repository

Twelve live pins, not just the four reusable defaults:

Location Sites
The four reusable workflows (harden_runner_allowlist defaults) 4
tag-push.yaml 2
release-drafter.yaml / clear-action-cache.yaml 2
examples/build-test-release{,-multiarch}/{github,gerrit}.yaml (consumers copy these) 4

Verified mechanically (per-file expected occurrence counts). docs/BRIEF.md keeps its original SHA on purpose — a historical record of the pins chosen during the design discussion.

Verification of the pin

  • Pinned SHA is the commit the annotated tag resolves to (git rev-list -n 1 v0.12.160d8d71…), not the tag object.
  • Yarn hosts confirmed present in allow_list.txt at the v0.12.1 tag.

Scope & validation

  • Single-step fix applied to all four reusable workflows; only the python-build job additionally folds in build_permit_egress_traffic.
  • Post-transform checks: no Harden runner (audit) toggle remains anywhere (the block-only steps in the internal/example workflows are single-step and correct); all 12 pins now read v0.12.1; computed egress-policy count = 6 / 6 / 9 / 10.
  • actionlint passes on all four reusable workflows.

Note

The branch name still reads …-v0.10.0. Renaming it would close and recreate this PR, so it is left as-is; the pin, commit message and this description all reference v0.12.1.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the reusable Python GitHub Actions workflows to improve reliability under harden-runner “block” mode by adding a build-only egress escape hatch and updating the harden-runner allow-list pin.

Changes:

  • Add a new build_permit_egress_traffic boolean input (default false) to let the python-build job run harden-runner in audit mode independently of other jobs.
  • Update harden_runner_allowlist default pin from v0.1.1 to v0.10.0 across all four reusable workflows.
  • Adjust python-build job harden-runner step conditions to honor build_permit_egress_traffic.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/build-test.yaml Adds build_permit_egress_traffic, bumps allow-list pin, and gates python-build harden-runner steps accordingly.
.github/workflows/build-test-multiarch.yaml Same changes applied to the multi-arch build workflow’s matrixed python-build job.
.github/workflows/build-test-release.yaml Same changes applied to the release workflow’s python-build job and allow-list pin.
.github/workflows/build-test-release-multiarch.yaml Same changes applied to the release multi-arch workflow’s matrixed python-build job and allow-list pin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings July 28, 2026 13:33
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the feat/build-egress-hatch-allowlist-v0.10.0 branch from 842ae41 to 780777d Compare July 28, 2026 13:33

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings July 28, 2026 15:08
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the feat/build-egress-hatch-allowlist-v0.10.0 branch from 780777d to 030d6ca Compare July 28, 2026 15:08

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings July 28, 2026 17:53
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the feat/build-egress-hatch-allowlist-v0.10.0 branch from 030d6ca to 23413ab Compare July 28, 2026 17:53

This comment was marked as outdated.

Add a 'build_permit_egress_traffic' input (boolean, default false)
that runs harden-runner in audit mode for the python-build job only,
leaving every other job governed by 'harden_runner_egress'. Build
lanes fetch dependencies from CDNs that are impractical to enumerate
in the egress allow-list; this narrows the exemption to the job that
needs it, rather than dropping every job to audit.

Each job uses a single harden-runner step with the egress policy
computed inline, not two steps selected by a step-level 'if:'.
harden-runner declares a 'pre' entry point and no 'pre-if', so its
pre-phase -- where the network policy engages -- runs regardless of
the condition. Two steps would both engage, block would win, and
audit mode (and this build hatch) would be silently unreachable. The
allow-list now loads unconditionally, a small fetch audit ignores.
This mirrors the fix applied in java-workflows.

Also bump the 'harden_runner_allowlist' default to .github v0.12.1.
The previous pin predates the Gerrit SSH (tcp/29418), Temurin and
Gradle endpoint additions, so block-mode jobs could not vote on a
Gerrit change or provision a JVM toolchain.

v0.12.0 added 66 entries, taking the list from 97 to 163: Linux
Foundation platform hosts from the inventory (documentation sites,
wikis and Jira tenants, the Nexus and Nexus3 artifact repositories
including their Docker registry ports 10001-10004, the JFrog
Artifactory instances, ReadTheDocs, and Gerrit for Anuket/OPNFV on
both 443 and 29418). v0.12.1 then adds the Yarn egress endpoints
(registry.yarnpkg.com and dl.yarnpkg.com).

The bump covers every live pin in the repository, not just the four
reusable defaults. The repository's own CI (tag-push.yaml twice,
release-drafter.yaml, clear-action-cache.yaml) and the four
build-test-release example callers each carried the same pin.

Twelve live pins now reference v0.12.1. The pin is the commit the
annotated tag resolves to, not the tag object. The occurrence in
docs/BRIEF.md keeps its original SHA on purpose, as a record of the
pins chosen during the design discussion.

Co-authored-by: Claude <claude@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions force-pushed the feat/build-egress-hatch-allowlist-v0.10.0 branch from 23413ab to b800302 Compare July 28, 2026 18:51
Copilot AI review requested due to automatic review settings July 28, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@tykeal
tykeal merged commit 8dbc151 into lfreleng-actions:main Jul 29, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants